package com.hexinfo.dmpro.monitor.dao;

import com.hexinfo.dmpro.monitor.model.cm.CountResourceInfo;
import com.hexinfo.dmpro.monitor.model.cm.DetailResourceInfo;
import com.hexinfo.dmpro.monitor.model.cm.ResourceBaseReqModel;
import com.hexinfo.dmpro.monitor.model.cm.YarnResourceInfo;
import com.hexinfo.dmpro.monitor.model.cm.UtilizationResourceInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 **/
@Repository
public interface CmYarnPoolDao {

    List<YarnResourceInfo> selYarnPoolTop(ResourceBaseReqModel req);

    List<YarnResourceInfo> selYarnPoolTopRange(ResourceBaseReqModel req);

    List<YarnResourceInfo> selYarnCpuTop(ResourceBaseReqModel req);

    List<YarnResourceInfo> selYarnCpuTopRange(ResourceBaseReqModel req);

    CountResourceInfo selYarnPoolAllCount(ResourceBaseReqModel req);

    List<CountResourceInfo> selYarnPoolYcCount(ResourceBaseReqModel req);

    List<CountResourceInfo> selYarnPoolYc(ResourceBaseReqModel req);

    List<DetailResourceInfo> selYarnPoolDetail(ResourceBaseReqModel req);

    List<UtilizationResourceInfo> selYarnPoolUtilization(ResourceBaseReqModel req);

    List<YarnResourceInfo> selYarnPoolSyl(ResourceBaseReqModel req);

    List<DetailResourceInfo> queryRootPool(@Param("cmFlag") String cmFlag,
                                     @Param("clusterFlag") String clusterFlag);

    DetailResourceInfo getRootPool(@Param("cmFlag") String cmFlag,
                                           @Param("clusterFlag") String clusterFlag);

    /**
     * 查询Yarn的服务名称
     * @param cmFlag
     * @param clusterFlag
     * @return
     */
    String selectServiceName(@Param("cmFlag") String cmFlag,@Param("clusterFlag") String clusterFlag,
                             @Param("type") String type);
}
